//
//  SearchResultView.h
//  OrderSeat
//
//  Created by 王威 on 13-12-13.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import <UIKit/UIKit.h>

@class SearchResultView;
@class SearchResultDataSource;
@protocol SearchResultViewDelegate <NSObject>

@optional
- (void)selectedRow:(NSDictionary *)row;
- (void)willShowWindow:(SearchResultView*)window;
- (void)willCloseWindow:(SearchResultView*)window;

@end

@interface SearchResultView : UIWindow

@property (weak, nonatomic)id<SearchResultViewDelegate> m_delegate;

@property (strong, nonatomic) UIView         *baseView;
@property (strong, nonatomic) UIView         *backgroundView;
@property (strong, nonatomic) UIImageView    *backImageView;
@property (strong, nonatomic) UITableView    *shopTable;
@property (strong, nonatomic) UILabel        *titleLabel;
@property (strong, nonatomic) UIButton       *closeBtn;
@property (copy  , nonatomic) NSString       *keyWord;

@property (strong, nonatomic) SearchResultDataSource *dataSource;

- (id)initWithKeyWord:(NSString*)keyWord andDelegate:(id<SearchResultViewDelegate>)delegate;

- (void)showWindow;
- (void)closeWindow;

@end

@interface SearchResultDataSource : BaseDataSource<UITableViewDelegate,UITableViewDataSource>

@property (strong, nonatomic) SearchResultView *view;
@property (strong, nonatomic) NSMutableArray *shopList;

- (id)initWithView:(SearchResultView *)view;
- (void)searchWithKeyWord:(NSString *)keyWord;

@end
